using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class PORequestMap : EntityTypeConfiguration<PORequest>
    {
        public PORequestMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FBrNo, t.FInterID });

            // Properties
            this.Property(t => t.FBrNo)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.FInterID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FBillNo)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FNote)
                .HasMaxLength(255);

            this.Property(t => t.FExplanation)
                .IsRequired()
                .HasMaxLength(255);

            // Table & Column Mappings
            this.ToTable("PORequest");
            this.Property(t => t.FBrNo).HasColumnName("FBrNo");
            this.Property(t => t.FInterID).HasColumnName("FInterID");
            this.Property(t => t.FBillNo).HasColumnName("FBillNo");
            this.Property(t => t.FDate).HasColumnName("FDate");
            this.Property(t => t.FDeptID).HasColumnName("FDeptID");
            this.Property(t => t.FRequesterID).HasColumnName("FRequesterID");
            this.Property(t => t.FBillerID).HasColumnName("FBillerID");
            this.Property(t => t.FCheckerID).HasColumnName("FCheckerID");
            this.Property(t => t.FCheckTime).HasColumnName("FCheckTime");
            this.Property(t => t.FNote).HasColumnName("FNote");
            this.Property(t => t.FClosed).HasColumnName("FClosed");
            this.Property(t => t.FTranType).HasColumnName("FTranType");
            this.Property(t => t.FMRP).HasColumnName("FMRP");
            this.Property(t => t.FSCBillInterID).HasColumnName("FSCBillInterID");
            this.Property(t => t.FStatus).HasColumnName("FStatus");
            this.Property(t => t.FCancellation).HasColumnName("FCancellation");
            this.Property(t => t.FMrpClosed).HasColumnName("FMrpClosed");
            this.Property(t => t.FMultiCheckLevel1).HasColumnName("FMultiCheckLevel1");
            this.Property(t => t.FMultiCheckLevel2).HasColumnName("FMultiCheckLevel2");
            this.Property(t => t.FMultiCheckLevel3).HasColumnName("FMultiCheckLevel3");
            this.Property(t => t.FMultiCheckLevel4).HasColumnName("FMultiCheckLevel4");
            this.Property(t => t.FMultiCheckLevel5).HasColumnName("FMultiCheckLevel5");
            this.Property(t => t.FMultiCheckLevel6).HasColumnName("FMultiCheckLevel6");
            this.Property(t => t.FMultiCheckDate1).HasColumnName("FMultiCheckDate1");
            this.Property(t => t.FMultiCheckDate2).HasColumnName("FMultiCheckDate2");
            this.Property(t => t.FMultiCheckDate3).HasColumnName("FMultiCheckDate3");
            this.Property(t => t.FMultiCheckDate4).HasColumnName("FMultiCheckDate4");
            this.Property(t => t.FMultiCheckDate5).HasColumnName("FMultiCheckDate5");
            this.Property(t => t.FMultiCheckDate6).HasColumnName("FMultiCheckDate6");
            this.Property(t => t.FCurCheckLevel).HasColumnName("FCurCheckLevel");
            this.Property(t => t.FCheckDate).HasColumnName("FCheckDate");
            this.Property(t => t.FExplanation).HasColumnName("FExplanation");
            this.Property(t => t.FSelTranType).HasColumnName("FSelTranType");
            this.Property(t => t.FChildren).HasColumnName("FChildren");
            this.Property(t => t.FMrpAutoClosed).HasColumnName("FMrpAutoClosed");
        }
    }
}
